﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleWebApi.MyMigration.Models.BusinessLicenseManagement
{
    public class LegalPerson : BaseEntity
    {
        public enum EducationLevel
        {
            小学,
            初中,
            高中,
            中专,
            大专,
            本科,
            不详
        }


        /// <summary>
        /// 姓名
        /// </summary>
        [Comment("姓名")]
        [Required]
        [StringLength(50)]
        public string Name { get; set; } // 姓名

        /// <summary>
        /// 民族
        /// </summary>        
        [StringLength(20)]
        [Comment("民族")]
        public string? Ethnicity { get; set; } // 民族

        /// <summary>
        /// 身份证号
        /// </summary>
        [Required]
        [Comment("身份证号")]
        [StringLength(18, MinimumLength = 18)]
        public string IdNumber { get; set; } // 身份证号

        /// <summary>
        /// 地址
        /// </summary>        
        [StringLength(255)]
        [Comment("地址")]
        public string? Address { get; set; } // 地址

        /// <summary>
        /// 联系电话
        /// </summary>
        [Required]
        [Comment("联系电话")]
        [StringLength(20)]
        public string Phone { get; set; } // 联系电话

        /// <summary>
        /// 微信
        /// </summary>
        [StringLength(50)]
        [Comment("微信")]
        public string? WeChat { get; set; } // 微信

        /// <summary>
        /// 学历
        /// </summary>
        [Required]
        [Comment("学历")]
        public EducationLevel Education { get; set; } = EducationLevel.不详;// 学历

        // 一对多关系
        public ICollection<BusinessLicense> BusinessLicenses { get; set; }
    }
}
